home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Date & Calendars / days-left.izs < prev    next >
Text File  |  2005-09-27  |  2KB  |  84 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Days Left
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>This script works out what the date is and from that works out how many days are left in the month!<!/DESCRIPTION> 
  7.  
  8. <!CATEGORY>calenders<!/CATEGORY>
  9.  
  10. <!SCRIPT>
  11. <!-- START OF SCRIPT -->
  12.  
  13. <!-- HOW TO INSTALL DAYS LEFT:
  14.  
  15.   1.  Copy the coding into the BODY of your HTML document  -->
  16.  
  17. <!-- STEP ONE: Paste this code into the BODY of your HTML document  -->
  18.  
  19. <BODY>
  20.  
  21. <SCRIPT LANGUAGE="JavaScript">
  22. <!-- Original:  Justin Smith (jsmith@polbox.com) -->
  23.  
  24.  
  25. <!-- Begin
  26. var today = new Date();
  27. var now = today.getDate();
  28. var year = today.getYear();
  29. if (year < 2000) year += 1900; // Y2K fix
  30. var month = today.getMonth();
  31.  
  32. var monarr = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
  33.  
  34. // check for leap year
  35. if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monarr[1] = "29";
  36.  
  37. // display day left
  38. document.write("There are " + (monarr[month]-now) + " days left in this Month.");
  39. //  End -->
  40. </script>
  41.  
  42.  
  43. <!-- END OF SCRIPT -->
  44. <!/SCRIPT>
  45.  
  46. <!PREVIEW>
  47. <!-- START OF SCRIPT -->
  48.  
  49.  
  50.  
  51. <!-- HOW TO INSTALL DAYS LEFT:
  52.  
  53.   1.  Copy the coding into the BODY of your HTML document  -->
  54.  
  55. <!-- STEP ONE: Paste this code into the BODY of your HTML document  -->
  56.  
  57. <BODY>
  58.  
  59. <SCRIPT LANGUAGE="JavaScript">
  60. <!-- Original:  Justin Smith (jsmith@polbox.com) -->
  61.  
  62.  
  63. <!-- Begin
  64. var today = new Date();
  65. var now = today.getDate();
  66. var year = today.getYear();
  67. if (year < 2000) year += 1900; // Y2K fix
  68. var month = today.getMonth();
  69.  
  70. var monarr = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
  71.  
  72. // check for leap year
  73. if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monarr[1] = "29";
  74.  
  75. // display day left
  76. document.write("There are " + (monarr[month]-now) + " days left in this Month.");
  77. //  End -->
  78. </script>
  79.  
  80.  
  81. <!-- END OF SCRIPT -->
  82. <!/PREVIEW>
  83.  
  84. <!RELATED>NONE<!/RELATED>